/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import java.util.Scanner;

/**
 * This is parent class of menu options that are displayed before running the intersection.
 * This class is not actually called directly itself for user meu interactions.
 * @author Luke
 */
public class UCMenuOption {

    /**
     *The string used to store the output of the particular menu option
     */
    public String menuOption;
    /**
     *The scanner used to get user input.
     */
    public Scanner theInput = new Scanner(System.in);

    /**
     *Method that is used to set the menu option text to the relevant value
     * @param aOption The relevant text for the option
     */
    public void set_MenuOption(String aOption) {
        menuOption = aOption; //set the Menu option to the value passed in
    }

    /**
     *Method to get the value of this menu option
     * @return The text value of the menu option
     */
    public String get_MenuOption() {
        return menuOption; //Output this menu option to the screen
    }

    /**
     *Method used to check the users input to see if it is a Integer value
     * @param someInput Is the string value of whatever the user inputs
     * @return This method returns 1 if the value is a valid integer or 0 if it isn't
     */
    public int checkInput(String someInput) {
        try {
            Integer.parseInt(someInput); //make the input into a int
            return 1; //its safe
        } catch (Exception e) {
            return 0; //its unsafe
        }
    }

    /**
     *Blank method that is implemented in all of the menu options for their specific purpose
     * @return Any object that is required for that specific menu option
     */
    public Object run() {
        return null;
        //to be overridden in other classes
    }
}
